/**
 * 
 */
package com.ar.myshares.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.ar.myshares.daos.InstrumentDAO;
import com.ar.myshares.model.Instrument;

/**
 * @author mac
 *
 */
public class InstrumentServiceImpl implements InstrumentSevice {

	@Autowired
	private InstrumentDAO instrumentDAO;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ar.myshares.services.InstrumentSevice#saveInstrument(com.ar.myshares
	 * .model.Instrument)
	 */
	@Override
	@Transactional
	public Instrument saveInstrument(Instrument instrument) {
		return instrumentDAO.saveInstrument(instrument);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ar.myshares.services.InstrumentSevice#removeInstrument(com.ar.myshares
	 * .model.Instrument)
	 */
	@Override
	@Transactional
	public void removeInstrument(Instrument instrument) {
		instrumentDAO.removeInstrument(instrument);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.ar.myshares.services.InstrumentSevice#getInstrument(long)
	 */
	@Override
	@Transactional(readOnly = true)
	public Instrument getInstrument(long id) {
		return instrumentDAO.getInstrument(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.ar.myshares.services.InstrumentSevice#getAllInstruments()
	 */
	@Override
	@Transactional(readOnly = true)
	public List<Instrument> getAllInstruments() {
		return instrumentDAO.getAllInstruments();
	}

}
